﻿using UnityEngine;
using System.Collections.Generic;
using ProtoBuf.Message;

namespace UI
{
    public class UICopyRunMapTopInfo : MonoBehaviour
    {
        public UILabel totalLabel;
        public UILabel totalCount;

        void Awake()
        {
            totalLabel.text = TableTextBlo.GetText("copy_run_enemy_info");
        }

        public void Init(object o)
        {
            //var info = (SCCopyRunMapInfo)o;
            int total = 0;
            int curr = 0;
            //var tasks = UICopyData.GetUILevelData(StaticData.currFightLevelId).level_tasks;

            var tasks = StaticData.jobs;
            var copy = Room.RoomManager.GetRoom(SceneType.COPY) as Room.RoomCopy;
            int deadCount = copy.deadMonsters.Count;

            curr = tasks.Count - deadCount;
            total = tasks.Count;

            ////1-1特殊处理了 1-2特殊处理 1-3特殊处理
            //if (StaticData.currFightChapterId == "1" )
            //{
            //    if (StaticData.currFightLevelId == "1")
            //        total = 2;
            //    if (StaticData.currFightLevelId == "2")
            //        total = 3;
            //    if (StaticData.currFightLevelId == "3")
            //        total = 3;
            //    curr = total - deadCount;
            //}

            totalCount.text = curr.ToString() + "/" + total.ToString();
        }
    }
}